print("开始简单测试...")

print("1. 导入基础模块...")
import os
import platform
from flask import Flask

print("2. 导入配置...")
from config import config

print("3. 测试环境配置...")
env = os.environ.get('FLASK_ENV', 'production')
app_config = config.get(env, config['production'])
print(f"环境: {env}")
print(f"调试模式: {app_config.DEBUG}")

print("4. 创建Flask应用...")
app = Flask(__name__)
app.config.from_object(app_config)

print("✅ 基础应用创建成功!")

print("5. 测试模型工具导入...")
try:
    from models.model_utils import get_device
    print("   get_device导入成功")
except Exception as e:
    print(f"   get_device导入失败: {e}")
    import traceback
    traceback.print_exc()

print("完成测试.")
